/******************************************************************************
*
*  Copyright (C), 2018, Eugene.Chan placetobe@163.com
*
 -----------------------------------------------------------------------------
* @file          : p_pwm.h
* @brief         : pwm control
*
* @author        : eugeneChan
* @mail          : placetobe@163.com
* @date          : 2018/10/9
* @version       : 0.0.0.1
* @license       : GNU General Public License (GPL)
*
* -----------------------------------------------------------------------------
* Change History :
* <Date>     |  <Version>  |  <Author>    |  <Description>
* 2018/10/9  |  0.0.0.01   |  eugeneChan |  Create File
*
******************************************************************************/

#ifndef __P_PWM_H__
#define __P_PWM_H__


#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */

/* include files ------------------------------------------------------------*/

/* constans & micro ---------------------------------------------------------*/
#define PWM_FREQ        (250000)
#define PWM_LED_R_AFIO      (GPIO_PA)
#define PWM_LED_R_GPIO      (HT_GPIOA)
#define PWM_LED_R_PIN       (GPIO_PIN_5)
#define PWM_LED_R_TM_CHANNEL    (TM_CH_1)

#define PWM_LED_B_AFIO      (GPIO_PA)
#define PWM_LED_B_GPIO      (HT_GPIOA)
#define PWM_LED_B_PIN       (GPIO_PIN_4)
#define PWM_LED_B_TM_CHANNEL    (TM_CH_0)


#define PWM_LED_W_AFIO      (GPIO_PA)
#define PWM_LED_W_GPIO      (HT_GPIOA)
#define PWM_LED_W_PIN       (GPIO_PIN_3)
#define PWM_LED_W_TM_CHANNEL    (TM_CH_3)
/* data types ---------------------------------------------------------------*/

/* global variables ---------------------------------------------------------*/

/* function prototypes ------------------------------------------------------*/
extern void p_pwm0_disable(void);
extern void p_pwm0_duty(void);
extern void p_pwm0_enable(void);
extern void p_pwm0_init(void);
extern void p_pwm0_stop(void);
extern void p_pwm1_disable(void);
extern void p_pwm1_duty(void);
extern void p_pwm1_enable(void);
extern void p_pwm1_init(void);
extern void p_pwm1_start(void);
extern void p_pwm1_stop(void);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */


#endif /* __P_PWM_H__ */
